package advance.proxy;

import advance.proxy.impl.UserManagerImpl;

/**
 * description: <br>
 * createTime: 2018/10/1118:04 <br>
 *
 * @author zzh
 */
public class Client {

    public static void main(String[] args) {
        UserManager userManager = (UserManager) new CGLibProxy()
                .createProxyObject(new UserManagerImpl());
        System.out.println("-----------CGLibProxy-------------");
        userManager.addUser("tom", "root");
        userManager.delUser("tom");
        System.out.println("-----------JDKProxy-------------");
        JDKProxy jdkPrpxy = new JDKProxy();
        UserManager userManagerJDK = (UserManager) jdkPrpxy.newProxy(new UserManagerImpl());
        userManagerJDK.addUser("tom", "root");
        userManagerJDK.delUser("tom");
    }
}
